public class Test23 {
    public static void main(String[] args) {
        Student s = new Student(2022001, "Lucy", 19, "Computer Science");

        System.out.println(s);
    }
}

class Student {
    int xh;//学号

    String name;

    int age;

    String major;

    public Student() {

    }

    public Student(int xh, String name, int age, String major) {
        this.xh = xh;
        this.name = name;
        this.age = age;
        this.major = major;
    }

    @Override
    public String toString() {
        return "xh: " + this.xh + " name: " + this.name + " age: " + this.age + " major: " + this.major;
    }
}